import main from '@src/main';

// 上传文件
export async function apiUploadFile(
  file: File,
  uploadProgress?: (loaded: number, total: number) => void,
  num?: number
) {
  main.uploadProgress = uploadProgress;
  let res = await main.api.post(
    `/resource/oss/upload`,
    { file, num },
    {
      headers: {
        'Content-Type': 'multipart/form-data',
      },
    }
  );

  return res;
}
